#include <iostream>

using namespace std;

class foo {
public:
        int a, b;
        static int count;
        foo() {count++;}
        ~foo() {count--;}
        static void xxx(void);
};

int foo::count = 0;

void foo::xxx(void)
{
        cout << __func__ << "()" << endl;
}

void yyy(void)
{
        cout << "call yyy()" << endl;

        foo bar;

        cout << foo::count << endl;
}

int main()
{
        foo bar;

        cout << foo::count << endl;

        foo *p = new foo;

        cout << foo::count << endl;

        yyy();
        cout << "yyy() return " << foo::count << endl;

        delete p;

        cout << foo::count << endl;

        foo::xxx();

        return 0;
}
